﻿using DAL;
using IService;
using Model;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Service
{
    public class WhStockTakeDetailService : IWhStockTakeDetailService
    {
        private readonly WhStockTakeDetailDal _dal;

        public WhStockTakeDetailService(WhStockTakeDetailDal dal)
        {
            _dal = dal;
        }

        public Task<int> CreateAsync(WhStockTakeDetail data)
        {
            return _dal.CreateAsync(data);
        }

        public Task<int> DeleteAsync(long Id)
        {
            return _dal.DeleteAsync(Id);
        }

        public Task<List<WhStockTakeDetail>> GetAllAsync()
        {
            return _dal.GetAllAsync();
        }

        public Task<WhStockTakeDetail> GetByIdAsync(long Id)
        {
            return _dal.GetByIdAsync(Id);
        }

        public Task<int> UpdateAsync(WhStockTakeDetail data)
        {
            return _dal.UpdateAsync(data);
        }

        /// <summary>
        /// 根据盘点单ID获取明细
        /// </summary>
        /// <param name="inventoryOrderId">盘点单ID</param>
        /// <returns>明细列表</returns>
        public Task<List<WhStockTakeDetail>> GetByInventoryOrderIdAsync(long inventoryOrderId)
        {
            return _dal.GetByInventoryOrderIdAsync(inventoryOrderId);
        }


    }
}